package com.zhu.service.edu.controller.admin;

import com.zhu.commons.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@Api(tags = "mock模拟登录")
@RestController
@RequestMapping("user")
//@CrossOrigin
public class LoginController {

    @PostMapping("login")
    @ApiOperation(value = "模拟登录暂用")
    public R login(){
        return R.ok().data("token","admin");
    }
    @GetMapping("info")
    public R info(){
        return R.ok().data("name","admin")
                .data("roles","[admin,admin]")
                .data("avatar","https://c-ssl.duitang.com/uploads/blog/202108/21/20210821060555_67898.jpg");
    }

    @PostMapping("logout")
    @ApiOperation(value = "模拟登录暂用")
    public R logout(){
        return R.ok();
    }
}
